package com.itheima.dao;

import com.itheima.pojo.Menu;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User findByUserName(@Param("username") String username);

    List<Menu> findOneMenu();

    List<Menu> findMenuByParentMenuId(@Param("id") Integer id);

    Integer selectCountByName(Menu menu);

    Integer findByParentMenuId(@Param("parentMenuId")Integer parentMenuId);

    Menu findParentMenuById(@Param("parentMenuId")Integer parentMenuId);

    void insertMenu(Menu menu);

    Integer findCountByMenuId(@Param("id") Integer id);

    List<Integer> findChildMenuByParentMenuId(@Param("id")Integer id);

    void removeMenuById(@Param("id")Integer id);

    Menu findById(@Param("id")Integer id);

    void edit(Menu menu);

    Integer findCountByMenu(Menu menu);

    List<Menu> findRightPage();
}
